﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<KnitwearCompany.Models.Product>" %>
<%@ Import Namespace="KnitwearCompany.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Просмотр категории <%= ( (KnitwearCompany.Models.Category) ViewData["category"]).Name %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Просмотр категории <%= ( (KnitwearCompany.Models.Category) ViewData["category"]).Name %></h2>

    <table width='900px'>
        <tr>
            <th>
                Название
            </th>
            <th>
                Описание
            </th>
            <th>
                Цена
            </th>
            <th></th>
        </tr>
    <% foreach (var item in (List<Product>)ViewData["products"]) { %>
        <tr>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Description) %>
            </td>
            <td>
                <%= Html.Encode(item.Price) %>
            </td>
            <td>
                <%= Html.ActionLink("Подробнее", "ViewProduct", new { ID = item.Id }) %>
            </td>
        </tr>
    <% } %>
    </table>

    <br/><br/>
    <%: Html.ActionLink("Назад", "Index", "Home") %>
</asp:Content>
